package com.itunion.ddd.web.controller;

import com.itunion.ddd.application.item.dto.clientobject.TbItemCategoryCO;
import com.itunion.ddd.application.item.service.TbItemCategoryApplicationService;
import com.itunion.ddd.common.base.BaseController;
import com.itunion.ddd.common.base.constant.BaseResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@RestController
@Slf4j
@Api(value = "商品", tags = "商品")
@RequestMapping("/api/item")
public class ItemController extends BaseController {

    @Autowired
    private TbItemCategoryApplicationService tbItemCategoryApplicationService;

    @ApiOperation(value = "分类详情", notes = "根据分类ID查询详情")
    @GetMapping(value = "/category/{id}")
    public BaseResponse<TbItemCategoryCO> listATAMetrics(@PathVariable("id") Long id){
        return this.success(tbItemCategoryApplicationService.selectById(id));
    }
}